#ifndef GRAPHICS_H
#define GRAPHICS_H

#include <SDL.h>
#include "Singleton.h"
#include "Colour.h"
#include "rapidxml.hpp"

namespace Engine
{
	class Graphics : public NonCopyable
	{
		private:
			friend class Singleton<Graphics>;
			int m_width;
			int m_height;
			int m_bitsPerPixel;
			SDL_Surface* m_buffer;
			bool m_fullScreen;
			Colour m_clearColour;

			Graphics();

		public:
			bool Initialize(int width, int height, unsigned int bpp = 0, bool fullScreen = false);
			bool Initialize(rapidxml::xml_node <>* node);

			//getters & setters
			void SetClearColour(const Colour& colour){m_clearColour = colour;}

			const int GetBitsPerPixel() const {return m_bitsPerPixel;}
			const bool IsFullScreen() const;
			int GetWidth() const {return m_width;}
			int GetHeight() const {return m_height;}

			void ClearScreen();
			void FlipBuffers();
	};

	typedef Singleton<Graphics> TheGraphics;
}

#endif